package com.study.manage.dal;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.study.manage.domain.EvaluatePrice;
import com.study.manage.domain.enumm.LiveDieState;

public interface EvaluatePriceRepository extends PagingAndSortingRepository<EvaluatePrice, Long> {

    List<EvaluatePrice> findByEvaluateIdAndState(Long evaluateId, LiveDieState state);

    int countByEvaluateIdAndState(Long evaluateId, LiveDieState state);

    @Query("select t.charge from EvaluatePrice t where t.evaluateId=:evaluateId and t.state=:state")
    List<String> findChargeByEvaluateIdAndState(@Param("evaluateId") Long evaluateId,
            @Param("state") LiveDieState state);

}
